Skip to content

Refactor#61

Merged
disafronov merged 19 commits into
mainfrom
refactor
May 5, 2026
Merged

Refactor#61
disafronov merged 19 commits into
mainfrom
refactor

Conversation

@disafronov
Copy link
Copy Markdown
Owner

No description provided.

disafronov added 19 commits May 5, 2026 23:31
Update the Makefile to pin the Python version via `.python-version` file used by uv and CI, and modify the install target to install dependencies with the specified Python version, ensuring consistent development environment and reproducibility.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Change test target in Makefile to run with coverage, removing need for separate test-coverage command, improving code quality and simplifying testing process

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Remove format from all target to prevent unnecessary reformatting of code, as it can introduce unwanted changes and make it harder to review test and dead-code check results. This change improves the efficiency of the all target by only running lint, test, and dead-code check.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update pre-commit-config.yaml to add check-case-conflict and name-tests-test hooks and remove make-format hook to improve code quality and consistency.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update pyproject.toml to include fail_under in coverage report to ensure 100% coverage is required for a successful test run, preventing partial coverage from being considered a pass.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Added a new test case to verify the behavior of the `check_cached_found_file_path` function when the cache contains a missing-file entry, ensuring it returns None as expected.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
The commit introduces several key improvements to the schema applier and loader.
It optimizes the schema applier by removing the use of defaultdict for grouping leaves by source field name,
instead using a compiled schema that stores this information.
The schema loader is also updated to include a compiled schema class that stores
the mapping of sources to leaves and the set of known sources.
These changes improve the efficiency and readability of the code.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Refactor _strip_empty function in schema_applier to correctly remove empty dicts and None values from nested structures, improving performance and readability by using an iterative approach instead of list comprehension.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
The error handling in the logging objects with schema module has been refactored to use dictionaries instead of JSON strings. This change was made to improve the efficiency and clarity of the error handling code. The new approach uses dictionaries to store error information, which can then be easily converted to JSON strings when needed. The refactor includes updates to the _DataProblem class and the _create_validation_error function, which now returns a dictionary instead of a JSON string. Additionally, the code has been updated to use the json.dumps function to convert the error dictionary to a JSON string when necessary. This change improves the overall structure and readability of the code, making it easier to maintain and extend in the future.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
* Removed _is_leaf_node function from schema_loader
* Removed import and usage of _is_leaf_node in test_schema_loader
* Removed tests related to _is_leaf_node in test_schema_loader

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Removed python 3.10 from test matrix to reflect current support and ensure compatibility with latest versions.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update pyproject.toml and uv.lock to require python 3.11, and update dependencies to match the new python version, ensuring compatibility and resolving potential issues with outdated dependencies.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Remove unused test and imports, update logger to use findCaller for all Python versions, improving performance.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Updated bandit from 1.9.2 to 1.9.4, click from 8.3.1 to 8.3.3 and other packages to ensure compatibility and resolve potential security issues. Added resolution markers for python 3.15.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update the pre-commit configuration to exclude tests/helpers.py instead of tests/runner.py to prevent unnecessary linting and improve performance. This change ensures that only relevant files are checked during the pre-commit stage.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update .pre-commit-config.yaml to correctly exclude tests/helpers.py files from all directories, ensuring accurate test runs by modifying the exclude pattern to ^(.*/)?tests/helpers\.py$ to account for file paths that may or may not include a leading directory.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Introduce .markdownlintignore file to exclude CHANGELOG.md from markdown linting to prevent false positives and allow for a more flexible changelog formatting.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
Update test_schema_logger to reflect changes in Python 3.11 logging
The removed tests, test_schema_logger_log_uses_inspect_stack_fallback_for_old_python and test_schema_logger_log_fallback_to_findcaller_when_stack_too_short, were specific to Python versions prior to 3.11 and are no longer relevant due to changes in logging behavior

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
* Removed unused import of __future__.annotations from multiple modules to improve code readability and remove unnecessary imports
* This change is intended to simplify code maintenance and adhere to Python's evolving type hinting standards, as the `__future__.annotations` import is not necessary in Python 3.7 and later versions where type hints are enabled by default.

Signed-off-by: Dmitrii Safronov <zimniy@cyberbrain.cc>
@disafronov disafronov merged commit c8ff073 into main May 5, 2026
12 checks passed
@disafronov disafronov deleted the refactor branch May 5, 2026 22:04
@disafronov
Copy link
Copy Markdown
Owner Author

🎉 This PR is included in version 0.4.2-rc.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant